package com.mcxx.modules.system.service.write;

import com.mcxx.modules.system.dao.write.CommonUserTipsLogWriteDao;
import com.mcxx.modules.system.entity.CommonUserTipsLogEntity;
import com.mcxx.util.Constant;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;


@Service
@TaTransactional
public class CommonUserTipsLogWriteService {
    @Autowired
    private CommonUserTipsLogWriteDao commonUserTipsLogWriteDao;


    public int insert(CommonUserTipsLogEntity entity){
        return commonUserTipsLogWriteDao.insert(entity);
    }

    public int insert(String userId,String tipsId){
        CommonUserTipsLogEntity entity = new CommonUserTipsLogEntity();
        entity.setId(Constant.getUUID());
        entity.setUserId(userId);
        entity.setTipsId(tipsId);
        entity.setCreateTime(new Date());
        return commonUserTipsLogWriteDao.insert(entity);
    }
}
